// create URL and Link const url = window.URL.createObjectURL(blob); const a = document.createElement("a"); a.href = url; a.download = filename; document.body.appendChild(a); // Invoke download a.click(); // remove URL and Link window.URL.revokeObjectURL(url); a.remove(); " />

使用JS实现文件下载代码

标签:2023-06-22 18:21:51
      // create URL and Link
      const url = window.URL.createObjectURL(blob);
      const a = document.createElement("a");
      a.href = url;
      a.download = filename;
      document.body.appendChild(a);

      // Invoke download
      a.click();

      // remove URL and Link
      window.URL.revokeObjectURL(url);
      a.remove();
原文出处:http://www.dongblog.com/notes/4.html
来源:博客网 转载请注明出处!

活跃用户

A.饼干租号收售号
Ta还没有签名
点点星
Ta还没有签名
熙笑
Ta还没有签名
Ta还没有签名

友情链接


Warning: Smarty error: unable to read resource: "../../../templates/default/./common/foot/footer_index.htm" in /usr/home/hyu3925200001/htdocs/common/smarty/Smarty.class.php on line 1093

Warning: Smarty error: unable to read resource: "../../../templates/default/./common/foot/footer_index.htm" in /usr/home/hyu3925200001/htdocs/common/smarty/Smarty.class.php on line 1093